<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
  <div id="app"></div>
  <script src="./index.js"></script>

  <script>
    // 1.通过h函数来创建一个vnode
    const vnode = h('div', {class: "why", id: "aaa"}, [
      h("h2", null, "当前计数: 100"),
      h("button", {onClick: function() {console.log('我在加一')}}, "+1")
    ]);

    // 2.通过mount函数，将vNode挂载到div#app下
    mount(vnode,document.querySelector("#app"))
    // patch函数
    const vnode2 = h('div', {class: "why", id: "aaa"}, [
      h("h2", null, "当前计数: 100"),
      h("button", {onClick: function() {console.log('我在减一')}}, "-1")
    ]);
    patch(vnode,vnode2)
  </script>
</body>
</html>